import { Router , Route , hashHistory } from 'react-router';

import Home from './home/Home';

ReactDOM.render(
    <Router onUpdate={routerChange} history={hashHistory}>
        <Route path="/" component={Home} />
        <Route path="detail/:id" getComponent={function(nextState, cb) {
           require.ensure([], (require) => {
               cb(null, require("./home/Detail"));
           })
        }} />
    </Router>,
    document.getElementById('app')
);

function routerChange(e){
  console.log(this)
};